
<!DOCTYPE html>
<html>
  <head>
    <title>后台管理系统</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <link href="__ROOT__/public/css/admin.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="__ROOT__/library/jquery/jquery-1.4.js"></script>
    <script type="text/javascript">
      //删除分类
      function delType(typeId)
      {
          if(confirm("是否删除该分类及分类下所有新闻？"))
          {
              window.location = "__APP__/Modtype/modtype/typeId/"+typeId;
          }
      }
      var oldTypeName;
      var oldArticleNums;
      var oldTypeId;
      var oldLink;
      //让某一行显示为文本框
      function showText(typeId)
      {
          hideText();
          
          oldTypeId = typeId;
          oldTypeName = $("#td"+typeId+"1").html();
          oldArticleNums = $("#td"+typeId+"2").html();
          oldLink = $("#td"+typeId+"3").html();

          $("#td"+typeId+"0").css("background-color","gray");
          $("#td"+typeId+"1").html("<input type='text' name='typeName' size='10' value='"+oldTypeName+"'>");
          $("#td"+typeId+"2").html("<input type='text' name='articleNums' size='10' value='"+oldArticleNums+"'>");
          $("#td"+typeId+"3").html("<a href='#' onclick='submitForm()'>更新</a>  <a href='#' onclick='hideText()'>取消</a>");
      }
      //点击了取消按扭
      function hideText()
      {
    	  $("#td"+oldTypeId+"0").css("background-color","white");
    	  $("#td"+oldTypeId+"1").html(oldTypeName);
    	  $("#td"+oldTypeId+"2").html(oldArticleNums);
    	  $("#td"+oldTypeId+"3").html(oldLink);
      }
      //点击了更新按扭
      function submitForm()
      {
          //设置表单的提交地址
          document.frm.action = "__APP__/Modtype/update/typeId/"+oldTypeId;
          //让表单提交
          document.frm.submit();
      }
    </script>
  </head>
  <body>
    <!-- 网站的头 -->
  <include file="Public:header"/>
   <!-- 当前位置 -->
    <div class="locationDiv">&nbsp;: 后台管理 : 修改分类</div>
    <!-- 正文内容 -->
    <div class="mainDiv clear">
      <!-- 左侧树状列表 -->
      <div class="leftDiv">
      <include file="Public:left"/>
      </div>
      <!-- 右侧页面内容 -->
      <div class="rightDiv">
        <br><br><br><br>
        <form name="frm" method="post" action="__APP__/Modtype/update.html">
        <table border="1" align="center" width="600" cellpadding="0" cellspacing="0">
          <tr class="modTypeDiv1">
            <td>类别名称</td>
            <td>新闻数</td>
            <td>&nbsp;</td>
          </tr>
          <volist name="newsInfo" id ="v">
          <tr class="modTypeDiv2" style="background-color:#FFFFFF;">
            <td id="td{$v.typeId}1" width="200">{$v.typeName}</td>
            <td id="td{$v.typeId}2" width="200">{$v.articleNums}</td>
            <td id="td{$v.typeId}3" width="200">
              <a href="#" onclick="showText({$v.typeId})">编辑</a>
              &nbsp;&nbsp;&nbsp;
              <a href="#" onclick="delType({$v.typeId})">删除</a>
            </td>
          </tr>
        </volist>
        </table>
        </form>
      </div>
    </div>
  </body>
</html>

















